import React from "react";
import ReactDOM from "react-dom";
import MyAlert from "../MyAlert";

export function  showAlert(props={}){
    if(typeof props=='string')props={message:props}
    const el=document.createElement("div");
    el.id="alert";
    document.querySelector("#root").appendChild(el)
    ReactDOM.render(
        <React.StrictMode>
            <MyAlert  {...props} $el={el} />
        </React.StrictMode>,
        el
    )
}